<!DOCTYPE html>
<html>
<head>
<title>EnemyZone - Cargar partida</title>
<style>
body {
	font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
	background-color: #42413C;
	background-image: url("images/background_2.jpg");
	margin: 0;
	padding: 0;
	color: #000;
}

table,th,td {
	background-color: #ddd;
	border: 1px solid black;
	border-collapse: collapse;
	width: 750px;
	text-align: left;
}

th,td {
	padding: 15px;
}

#header {
	background-color: #42413C;
	color: white;
}

a {
	text-decoration: none;
}

a:hover {
	border-bottom: solid 1px;
}
</style>
<script type="text/javascript"
	src="http://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript" src="scripts/URLs.js"></script>
<script>
	$(function() {
		$.ajax({
			type : "GET",
			url : getListarPartidasURL(),
			contentType : "application/xml; charset=utf-8",
			dataType : "xml",
			success : function(data) {
				$(data).find('partida').each(
						function() {
							var idPartida = $(this).find("id").text();
							var nombre = $(this).find("nobre").text();
							var fecha = $(this).find("fecha").text();
							$('#listaPartidas').append(
									$('<tr>').append(
											$('<td>').append(
													$('<a>').attr('href', 'javascript:click(' + idPartida +')')
															.append(nombre)
															.append())).append($('<td>').append(
													$('<a>').attr('href', 'javascript:click(' + idPartida +')')
															.append(fecha)
															.append()))
															);
						});
			}

		});
	});

	function click(id){
		window.location.href = getJuegoURL() + "?Partida="
		+ id + "&Status=" + "cargar";
	}
	
</script>
</head>
<body>
	<div align="center">
		<p>
			<br> <img src=images/btn_CargarPartidaGuardada.png width=auto height=auto> <br> <br> <br>
			<br> <br> <br> <br> <br> <br> <br>
			<br> <br> <br> <br> <br>
		</p>

		<table>
			<tr>
				<th id="header">Partida</th>
				<th id="header">Fecha</th>
			</tr>
			<tbody id="listaPartidas"></tbody>
		</table>
	</div>
</body>
</html>